#include<bits/stdc++.h>
using namespace std;
#define int long long
signed main() {
//	system("start https://www.lanqiao.cn/problems/323/learning/");

	string s, t;
	cin >> s >> t;

	sort(s.begin(), s.end());
	sort(t.begin(), t.end());

	if (s.find(t) != string::npos)
		cout << "YES";
	else
		cout << "NO";

	return 0;
}
